package com.dragon.modules.yuegou.query.busd;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.busd.BtypeEntity;
import com.dragon.modules.yuegou.enums.busd.BtypeSourceType;
import com.dragon.modules.yuegou.enums.busd.BtypeType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 业态信息表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-07-24 11:00:28
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class BtypeQuery extends BtypeEntity implements Query<BtypeEntity> {

	private static final long serialVersionUID = 1L;


    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商圈ID查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "btypeSort")
	private Condition<Integer> btypeSortCondition;

    /** 服务费比率查询条件 */
	@JsonUnwrapped(prefix = "feeRatio")
	private Condition<BigDecimal> feeRatioCondition;

    /** 父级业态查询条件 */
	@JsonUnwrapped(prefix = "parentId")
	private Condition<String> parentIdCondition;

    /** 业态编号查询条件 */
	@JsonUnwrapped(prefix = "btypeNumber")
	private Condition<String> btypeNumberCondition;

    /** 业态名称查询条件 */
	@JsonUnwrapped(prefix = "name")
	private Condition<String> nameCondition;

    /** [枚举]业态等级：1-一级-ONE、2-二级-TWO查询条件 */
	@JsonUnwrapped(prefix = "type")
	private Condition<BtypeType> typeCondition;

    /** 业态说明查询条件 */
	@JsonUnwrapped(prefix = "remarks")
	private Condition<String> remarksCondition;

    /** 创建人ID查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 更新人ID查询条件 */
	@JsonUnwrapped(prefix = "modifiedBy")
	private Condition<String> modifiedByCondition;

    /** 更新时间查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

    /** 逻辑删除，1表示已删除,0表示未删除查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

    /** 删除人ID查询条件 */
	@JsonUnwrapped(prefix = "delBy")
	private Condition<String> delByCondition;

    /** 删除时间查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;
	
    /** [枚举]来源类型：0-悦商圈-YSQ、1-主数据-MASTER查询条件 */
	@JsonUnwrapped(prefix = "sourceType")
	private Condition<BtypeSourceType> sourceTypeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public BtypeQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public BtypeQuery(BtypeEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public BtypeQuery(BtypeQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.btypeSortCondition != null) {
			this.btypeSortCondition = other.btypeSortCondition.copy();
		}
		if(other.feeRatioCondition != null) {
			this.feeRatioCondition = other.feeRatioCondition.copy();
		}
		if(other.parentIdCondition != null) {
			this.parentIdCondition = other.parentIdCondition.copy();
		}
		if(other.btypeNumberCondition != null) {
			this.btypeNumberCondition = other.btypeNumberCondition.copy();
		}
		if(other.nameCondition != null) {
			this.nameCondition = other.nameCondition.copy();
		}
		if(other.typeCondition != null) {
			this.typeCondition = other.typeCondition.copy();
		}
		this.setOther(other);
	}

	private void setOther(BtypeQuery other){
		if(other.remarksCondition != null) {
			this.remarksCondition = other.remarksCondition.copy();
		}
		if(other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.modifiedByCondition != null) {
			this.modifiedByCondition = other.modifiedByCondition.copy();
		}
		if(other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
		if(other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		if(other.delByCondition != null) {
			this.delByCondition = other.delByCondition.copy();
		}
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
		if(other.sourceTypeCondition != null) {
			this.sourceTypeCondition = other.sourceTypeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<BtypeEntity> toQueryWrapper() {
		QueryWrapper<BtypeEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (btypeSortCondition != null) {
			btypeSortCondition.toWrapper(wrapper, COL_BTYPE_SORT);
		}
		if (feeRatioCondition != null) {
			feeRatioCondition.toWrapper(wrapper, COL_FEE_RATIO);
		}
		if (parentIdCondition != null) {
			parentIdCondition.toWrapper(wrapper, COL_PARENT_ID);
		}
		if (btypeNumberCondition != null) {
			btypeNumberCondition.toWrapper(wrapper, COL_BTYPE_NUMBER);
		}
		if (nameCondition != null) {
			nameCondition.toWrapper(wrapper, COL_NAME);
		}
		if (typeCondition != null) {
			typeCondition.toWrapper(wrapper, COL_TYPE);
		}
		return getQueryWrapper(wrapper);
	}

	private QueryWrapper<BtypeEntity> getQueryWrapper(QueryWrapper<BtypeEntity> wrapper){
		if (remarksCondition != null) {
			remarksCondition.toWrapper(wrapper, COL_REMARKS);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (modifiedByCondition != null) {
			modifiedByCondition.toWrapper(wrapper, COL_MODIFIED_BY);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		if (delByCondition != null) {
			delByCondition.toWrapper(wrapper, COL_DEL_BY);
		}
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		if (sourceTypeCondition != null) {
			sourceTypeCondition.toWrapper(wrapper, COL_SOURCE_TYPE);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈ID查询条件
	 * 
	 * @param busdIdCondition 商圈ID查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return btypeSortCondition 查询条件
	 */
	public Condition<Integer> btypeSort() {
		this.btypeSortCondition = new Condition<>();
		return this.btypeSortCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return btypeSortCondition 查询条件
	 */
	public Condition<Integer> getBtypeSortCondition() {
		return btypeSortCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param btypeSortCondition 查询条件
	 */
	public void setBtypeSortCondition(Condition<Integer> btypeSortCondition) {
		this.btypeSortCondition = btypeSortCondition;
	}

	/**
	 * 构造并返回服务费比率查询条件
	 * 
	 * @return feeRatioCondition 服务费比率查询条件
	 */
	public Condition<BigDecimal> feeRatio() {
		this.feeRatioCondition = new Condition<>();
		return this.feeRatioCondition;
	}
	
	/**
	 * 获取服务费比率查询条件
	 * 
	 * @return feeRatioCondition 服务费比率查询条件
	 */
	public Condition<BigDecimal> getFeeRatioCondition() {
		return feeRatioCondition;
	}

	/**
	 * 设置服务费比率查询条件
	 * 
	 * @param feeRatioCondition 服务费比率查询条件
	 */
	public void setFeeRatioCondition(Condition<BigDecimal> feeRatioCondition) {
		this.feeRatioCondition = feeRatioCondition;
	}

	/**
	 * 构造并返回父级业态查询条件
	 * 
	 * @return parentIdCondition 父级业态查询条件
	 */
	public Condition<String> parentId() {
		this.parentIdCondition = new Condition<>();
		return this.parentIdCondition;
	}
	
	/**
	 * 获取父级业态查询条件
	 * 
	 * @return parentIdCondition 父级业态查询条件
	 */
	public Condition<String> getParentIdCondition() {
		return parentIdCondition;
	}

	/**
	 * 设置父级业态查询条件
	 * 
	 * @param parentIdCondition 父级业态查询条件
	 */
	public void setParentIdCondition(Condition<String> parentIdCondition) {
		this.parentIdCondition = parentIdCondition;
	}

	/**
	 * 构造并返回业态编号查询条件
	 * 
	 * @return btypeNumberCondition 业态编号查询条件
	 */
	public Condition<String> btypeNumber() {
		this.btypeNumberCondition = new Condition<>();
		return this.btypeNumberCondition;
	}
	
	/**
	 * 获取业态编号查询条件
	 * 
	 * @return btypeNumberCondition 业态编号查询条件
	 */
	public Condition<String> getBtypeNumberCondition() {
		return btypeNumberCondition;
	}

	/**
	 * 设置业态编号查询条件
	 * 
	 * @param btypeNumberCondition 业态编号查询条件
	 */
	public void setBtypeNumberCondition(Condition<String> btypeNumberCondition) {
		this.btypeNumberCondition = btypeNumberCondition;
	}

	/**
	 * 构造并返回业态名称查询条件
	 * 
	 * @return nameCondition 业态名称查询条件
	 */
	public Condition<String> name() {
		this.nameCondition = new Condition<>();
		return this.nameCondition;
	}
	
	/**
	 * 获取业态名称查询条件
	 * 
	 * @return nameCondition 业态名称查询条件
	 */
	public Condition<String> getNameCondition() {
		return nameCondition;
	}

	/**
	 * 设置业态名称查询条件
	 * 
	 * @param nameCondition 业态名称查询条件
	 */
	public void setNameCondition(Condition<String> nameCondition) {
		this.nameCondition = nameCondition;
	}

	/**
	 * 构造并返回[枚举]业态等级：1-一级-ONE、2-二级-TWO查询条件
	 * 
	 * @return typeCondition [枚举]业态等级：1-一级-ONE、2-二级-TWO查询条件
	 */
	public Condition<BtypeType> type() {
		this.typeCondition = new Condition<>();
		return this.typeCondition;
	}
	
	/**
	 * 获取[枚举]业态等级：1-一级-ONE、2-二级-TWO查询条件
	 * 
	 * @return typeCondition [枚举]业态等级：1-一级-ONE、2-二级-TWO查询条件
	 */
	public Condition<BtypeType> getTypeCondition() {
		return typeCondition;
	}

	/**
	 * 设置[枚举]业态等级：1-一级-ONE、2-二级-TWO查询条件
	 * 
	 * @param typeCondition [枚举]业态等级：1-一级-ONE、2-二级-TWO查询条件
	 */
	public void setTypeCondition(Condition<BtypeType> typeCondition) {
		this.typeCondition = typeCondition;
	}

	/**
	 * 构造并返回业态说明查询条件
	 * 
	 * @return remarksCondition 业态说明查询条件
	 */
	public Condition<String> remarks() {
		this.remarksCondition = new Condition<>();
		return this.remarksCondition;
	}
	
	/**
	 * 获取业态说明查询条件
	 * 
	 * @return remarksCondition 业态说明查询条件
	 */
	public Condition<String> getRemarksCondition() {
		return remarksCondition;
	}

	/**
	 * 设置业态说明查询条件
	 * 
	 * @param remarksCondition 业态说明查询条件
	 */
	public void setRemarksCondition(Condition<String> remarksCondition) {
		this.remarksCondition = remarksCondition;
	}

	/**
	 * 构造并返回创建人ID查询条件
	 * 
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取创建人ID查询条件
	 * 
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置创建人ID查询条件
	 * 
	 * @param createdByCondition 创建人ID查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回更新人ID查询条件
	 * 
	 * @return modifiedByCondition 更新人ID查询条件
	 */
	public Condition<String> modifiedBy() {
		this.modifiedByCondition = new Condition<>();
		return this.modifiedByCondition;
	}
	
	/**
	 * 获取更新人ID查询条件
	 * 
	 * @return modifiedByCondition 更新人ID查询条件
	 */
	public Condition<String> getModifiedByCondition() {
		return modifiedByCondition;
	}

	/**
	 * 设置更新人ID查询条件
	 * 
	 * @param modifiedByCondition 更新人ID查询条件
	 */
	public void setModifiedByCondition(Condition<String> modifiedByCondition) {
		this.modifiedByCondition = modifiedByCondition;
	}

	/**
	 * 构造并返回更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 更新时间查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 更新时间查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置更新时间查询条件
	 * 
	 * @param modifiedTimeCondition 更新时间查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

	/**
	 * 构造并返回逻辑删除，1表示已删除,0表示未删除查询条件
	 * 
	 * @return delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}
	
	/**
	 * 获取逻辑删除，1表示已删除,0表示未删除查询条件
	 * 
	 * @return delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置逻辑删除，1表示已删除,0表示未删除查询条件
	 * 
	 * @param delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回删除人ID查询条件
	 * 
	 * @return delByCondition 删除人ID查询条件
	 */
	public Condition<String> delBy() {
		this.delByCondition = new Condition<>();
		return this.delByCondition;
	}
	
	/**
	 * 获取删除人ID查询条件
	 * 
	 * @return delByCondition 删除人ID查询条件
	 */
	public Condition<String> getDelByCondition() {
		return delByCondition;
	}

	/**
	 * 设置删除人ID查询条件
	 * 
	 * @param delByCondition 删除人ID查询条件
	 */
	public void setDelByCondition(Condition<String> delByCondition) {
		this.delByCondition = delByCondition;
	}

	/**
	 * 构造并返回删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}
	
	/**
	 * 获取删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置删除时间查询条件
	 * 
	 * @param delTimeCondition 删除时间查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}
	
	/**
	 * 构造并返回[枚举]来源类型：0-悦商圈-YSQ、1-主数据-MASTER查询条件
	 * 
	 * @return sourceTypeCondition [枚举]来源类型：0-悦商圈-YSQ、1-主数据-MASTER查询条件
	 */
	public Condition<BtypeSourceType> sourceType() {
		this.sourceTypeCondition = new Condition<>();
		return this.sourceTypeCondition;
	}
	
	/**
	 * 获取[枚举]来源类型：0-悦商圈-YSQ、1-主数据-MASTER查询条件
	 * 
	 * @return sourceTypeCondition [枚举]来源类型：0-悦商圈-YSQ、1-主数据-MASTER查询条件
	 */
	public Condition<BtypeSourceType> getSourceTypeCondition() {
		return sourceTypeCondition;
	}

	/**
	 * 设置[枚举]来源类型：0-悦商圈-YSQ、1-主数据-MASTER查询条件
	 * 
	 * @param sourceTypeCondition [枚举]来源类型：0-悦商圈-YSQ、1-主数据-MASTER查询条件
	 */
	public void setSourceTypeCondition(Condition<BtypeSourceType> sourceTypeCondition) {
		this.sourceTypeCondition = sourceTypeCondition;
	}

}
